#!/bin/bash

cp ./build/kylin-mobile-assistant /usr/bin/
cp ./mobile-assistant.desktop /usr/share/applications/
cp ./third_party/scrcpy-server.jar /usr/share/kylin-mobile-assistant/
cp ./third_party/sndcpy /usr/share/kylin-mobile-assistant/
cp -r ./translations/ /usr/share/kylin-mobile-assistant/
cp ./plugin/peony-vfs-kylin-multiterminal/lib/libpeony-vfs-kylin-multiterminal.so /lib
cp ./plugin/peony-send-to-mobile-assistant/lib/libpeony-send-to-mobile-assistant.so /lib

lupdate -verbose kylin-mobile-assistant.pro

#arch
get_arch=`uname -i`
if [[ $get_arch =~ "x86_64" ]];then
    mv /lib/libpeony-vfs-kylin-multiterminal.so /lib/x86_64-linux-gnu/peony-extensions/
    mv /lib/libpeony-send-to-mobile-assistant.so /lib/x86_64-linux-gnu/peony-extensions/
elif [[ $get_arch =~ "aarch64" ]];then
    mv /lib/libpeony-vfs-kylin-multiterminal.so /lib/aarch64-linux-gnu/peony-extensions/
    mv /lib/libpeony-send-to-mobile-assistant.so /lib/aarch64-linux-gnu/peony-extensions/
else
    echo "unknown!!"
fi

